<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2013 Michal Lulco <michal.lulco@gmail.com>
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
 * [CLASS/FUNCTION INDEX of SCRIPT]
 *
 * Hint: use extdeveval to insert/update function index above.
 */

require_once(PATH_tslib.'class.tslib_pibase.php');


/**
 * Plugin 'jnreality header' for the 'main' extension.
 *
 * @author	Michal Lulco <michal.lulco@gmail.com>
 * @package	Main
 * @subpackage	tx_main
 */
class tx_main_header extends tslib_pibase {
	var $prefixId      = 'tx_main_header';		// Same as class name
	var $scriptRelPath = 'header/class.tx_main_header.php';	// Path to this script relative to the extension dir.
	var $extKey        = 'main';	// The extension key.
	var $pi_checkCHash = true;
	
	/**
	 * The main method of the PlugIn
	 *
	 * @param	string		$content: The PlugIn content
	 * @param	array		$conf: The PlugIn configuration
	 * @return	The content that is displayed on the website
	 */
	function main($content, $conf)	{
		$GLOBALS['TSFE']->additionalHeaderData['style.css'] = '<link href="fileadmin/templates/style.css" rel="stylesheet" type="text/css" />';
		$GLOBALS['TSFE']->additionalHeaderData['print.css'] = '<link href="fileadmin/templates/print.css" rel="stylesheet" type="text/css" media="print"/>';
		
		$GLOBALS['TSFE']->additionalHeaderData['css/superfish.css'] = '<link href="fileadmin/templates/css/superfish.css" rel="stylesheet" type="text/css" />';
		$GLOBALS['TSFE']->additionalHeaderData['js/fancybox/jquery.fancybox-1.3.4.css'] = '<link href="fileadmin/templates/js/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />';
		$GLOBALS['TSFE']->additionalHeaderData['css/selectbox.css'] = '<link href="fileadmin/templates/css/selectbox.css" rel="stylesheet" type="text/css" />';
		
		$GLOBALS['TSFE']->additionalHeaderData['external/jquery.min.js'] = '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['fancybox/jquery.mousewheel-3.0.4.pack.js'] = '<script type="text/javascript" src="fileadmin/templates/js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['fancybox/jquery.fancybox-1.3.4.pack.js'] = '<script type="text/javascript" src="fileadmin/templates/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['fancybox/jquery.fancybox-1.3.4.js'] = '<script type="text/javascript" src="fileadmin/templates/js/fancybox/jquery.fancybox-1.3.4.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['jflickrfeed.min.js'] = '<script type="text/javascript" src="fileadmin/templates/js/jflickrfeed.min.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['setup.js'] = '<script type="text/javascript" src="fileadmin/templates/js/setup.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['hover.js'] = '<script type="text/javascript" src="fileadmin/templates/js/hover.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['slideshow.js'] = '<script type="text/javascript" src="fileadmin/templates/js/slideshow.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['superfish.js'] = '<script type="text/javascript" src="fileadmin/templates/js/superfish.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['superfish_selector'] = '<script type="text/javascript">
			jQuery(function(){
				jQuery("ul.sf-menu").superfish();
			}); 
		</script>';
		$GLOBALS['TSFE']->additionalHeaderData['jquery.tipsy.js'] = '<script type="text/javascript" src="fileadmin/templates/js/jquery.tipsy.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['tipsy_gravity'] = '<script type="text/javascript">
			$(function() {    
				$(".sociable li a img").tipsy({gravity: "s"});		
			});
		</script>';
		$GLOBALS['TSFE']->additionalHeaderData['jquery.sparkbox-select.js'] = '<script type="text/javascript" src="fileadmin/templates/js/jquery.sparkbox-select.js"></script>';
		$GLOBALS['TSFE']->additionalHeaderData['sbCustomSelect'] = '<script type="text/javascript">
			$(document).ready(function() {  
				$("#search-select").sbCustomSelect(true);
				$(".sort").sbCustomSelect();
			});
		</script>';
		
		$box = new HeaderBox();
		return $box->render();
	}
}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/main/header/class.tx_main_header.php']) {
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/main/header/class.tx_main_header.php']);
}

?>